{% load pagetag %}
{% if is_paginated %}
<div class="panel-default">
    <center>
        <ul class="pagination">

            <li><a href="{{ request.path }}?page=1&{{ view.sort_f }}={{ view.sort_f_value }}">«</a></li>

            {% if page_obj.has_previous %}
            <li><a href="{{ request.path }}?&page={{ page_obj.previous_page_number }}&{{ view.sort_f }}={{ view.sort_f_value }}">上一页</a></li>
            {% else %}
                <li class="previous disabled"><a>上一页</a></li>
            {% endif %}

            {% for i in page_obj.paginator.page_range %}
                <!--{% circle_page page_obj.number i %}-->
                <li {% if page_obj.number == i %}class="active"{% endif %}><a href="{{ request.path }}?page={{ i }}&{{ view.sort_f }}={{ view.sort_f_value }}">{{ i }}</a></li>
            {% endfor %}

            {% if page_obj.has_next %}
                <li><a href="{{ request.path }}?page={{ page_obj.next_page_number }}&{{ view.sort_f }}={{ view.sort_f_value }}">下一页</a></li>
            {% else %}
                <li class="previous disabled"><a>下一页</a></li>
            {% endif %}

            <li><a href="{{ request.path }}?page={{ page_obj.paginator.num_pages }}&{{ view.sort_f }}={{ view.sort_f_value }}">»</a></li>

        </ul>
    </center>
</div>
{%endif%}
